﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true"
    CodeBehind="CostCentre.aspx.cs" Inherits="Billing2.CostCentre" %>

<%@ Register Src="~/Controls/Admin/ucCostCentre.ascx" TagName="ucCostCentre" TagPrefix="uc1" %>
<%@ Register Src="~/Controls/ucPageTitle.ascx" TagName="ucPageTitle" TagPrefix="uc2" %>
<%@ Register Src="~/Controls/ucInProgress.ascx" TagName="ucInProgress" TagPrefix="uc3" %>
<%@ Register Src="~/Controls/ucSearch.ascx" TagName="ucSearch" TagPrefix="uc4" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        $(function () {
            // Dialog 
            $('#dialogSave').dialog({
                autoOpen: false,
                width: 600,
                modal: true
            });
            $('#dialog').parent().appendTo($("form"));

            $('#dialogUpdate').dialog({
                autoOpen: false,
                width: 600,
                modal: true
            });
            $('#dialog').parent().appendTo($("form"));
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <uc2:ucPageTitle ID="ucPageTitle1" runat="server" />
    <asp:UpdatePanel ID="UpdatePanel5" runat="server">
        <ContentTemplate>
            <uc4:ucSearch ID="ucSearch" runat="server" />
        </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    <asp:UpdatePanel ID="UpdatePanel3" runat="server">
        <ContentTemplate><div class="gridDetail">
            <asp:GridView ID="gvwCostCenter" runat="server" CellPadding="4" CssClass="GridViewStyle"
                GridLines="Horizontal" AutoGenerateColumns="False" OnRowCommand="gvwCostCenter_RowCommand"
                AllowPaging="True" AllowSorting="True" OnPageIndexChanging="gvwCostCenter_PageIndexChanging"
                PageSize="50" EnableSortingAndPagingCallbacks="True"
                OnSorting="gvwCostCenter_Sorting" PagerSettings-Mode="NumericFirstLast" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" ForeColor="Black">
                <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                <RowStyle CssClass="GridViewRowStyle" />
                <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                <HeaderStyle CssClass="GridViewHeaderStyle" BackColor="#333333" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                <Columns>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="No">
                        <ItemTemplate>
                            <asp:Label ID="xCol01" runat="server" Text='<%#Container.DataItemIndex+1  %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Organization ID"
                        SortExpression="OrgIDName">
                        <ItemTemplate>
                            <asp:Label ID="xCol02" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("OrgIDName")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Site ID" SortExpression="SiteIDName">
                        <ItemTemplate>
                            <asp:Label ID="xCol03" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("SiteIDName")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Cost Centre ID"
                        SortExpression="CostCentreIDName">
                        <ItemTemplate>
                            <asp:LinkButton runat="server" ID="linkBtnEdit" CommandArgument='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("ID")))%>'
                                CommandName="EditData" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("CostCentreIDName")))%>'></asp:LinkButton>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Cost Centre Name"
                        SortExpression="CostCentreName">
                        <ItemTemplate>
                            <asp:Label ID="xCol05" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("CostCentreName")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Active" SortExpression="CostCentreStatus">
                        <ItemTemplate>
                            <asp:Label ID="xCol06" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("CostCentreStatus")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                </Columns>
                <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
            </asp:GridView></div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    <asp:UpdatePanel ID="UpdatePanel4" runat="server">
        <ContentTemplate>
            <asp:Button ID="btnAdd" runat="server" Text="Add" CausesValidation="false" CssClass="ui-state-default ui-corner-all"
                OnClick="btnAdd_Click" />
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel4">
        <ProgressTemplate>
            <uc3:ucInProgress ID="ucInProgress" runat="server" />
        </ProgressTemplate>
    </asp:UpdateProgress>
    <br />
    <br />
    <div id="dialogSave" title="Add Cost Centre" style="display: none">
        <div id="dialogSaveEffect">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <uc1:ucCostCentre ID="ucCostCentre1" runat="server" />
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </div>
    <div id="dialogUpdate" title="Edit Cost Centre" style="display: none">
        <div id="dialogUpdateEffect">
            <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                <ContentTemplate>
                    <uc1:ucCostCentre ID="ucCostCentre2" runat="server" />
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </div>
    <br />
</asp:Content>
